cc.Class({
    extends: cc.Component,

    properties: {
        // 等待捡起来的武器
        physicsGun:{
            default:null,
            type:cc.Prefab,
        },
    },

    // use this for initialization
    onLoad: function () {
    },
    setDirection:function(gunX,gunY){
        var bevel_edge=Math.sqrt((gunX*gunX)+(gunY*gunY))
        var angle=Math.acos(gunX/bevel_edge);
        if(gunY>0){
            angle=-1*(angle*360)/(2*3.1415926);
        }else{
            angle=(angle*360)/(2*3.1415926);
        }
        this.node.rotation = angle;
    },
    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
